{% extends "base.html" %}

{% block content %}
    <h2>This is a portfolio page</h2>
    
    <div class="portfolio-wrapper">
    
        <div class="portfolio-cats">
            <ul>
            {% for cat in cats %}
                    <li><a href="#{{ cat.name|escape }}">{{ cat.title|escape }}</a></li>
            {% endfor %}
            </ul>
        </div>
        
        <div class="portfolio">
        {# TODO: Оптимизировать! #}
        {% for cat in cats %}
        <h3><a name="{{ cat.name|escape }}"></a>{{ cat.title|escape }}</h3>
            {% for item in items %}
                {% ifequal cat.key item.category.key %}
                <div class="portfolio-item">
                        <a href="/portfolio/image/{{ item.key.id }}/full" title="{{ item.name|escape }}">
                            <img src="/portfolio/image/{{ item.key.id }}/thumb" alt="{{ item.name|escape }}">
                        </a>
                </div>
                {% endifequal %}
            {% endfor %}
            <div class="clear">&nbsp;</div> 
        {% endfor %}
        </div>
    
    </div>
    
{% endblock %}